package com.lagou.repository;

import com.lagou.entity.Position;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
 * @param
 * @author oyz
 * @version 1.0.4
 * @description: TODO
 * @date 2022/9/11 13:30
 */
public interface PositionRepository extends JpaRepository<Position,Long> {


    @Query(nativeQuery = true,value = "select p.name,p.salary,pd.description from position p join position_detail pd on p.id = pd.pid where p.id = :id")
    public Object findPositionsById(@Param("id") Long id); ;
}
